function [data, surfaces, surfaceName, population, geoAggLevelNames, geoAggLevelLabels, ...
    timeAggLevelNames, timeAggLevelLabels] = getRealData0(config)
	
	% Load data file
	load(config.datasetFile, 'data');
	
	% Read dimensions
	[Tall, Kall, ~] = size(data.X);
	
	% Get surface (if passed)
	if isfield(config, 'surfaceVar_Zname')
		[~,surfaceColIdx] = ismember(config.surfaceVar_Zname, data.Znames);
		surfaces	= data.Z(:,surfaceColIdx); 	% Kall x 1
		surfaceName = config.surfaceVar_Zname;% string
	else
		surfaces = ones(Kall, 1);	% Kall x 1
		surfaceName = '';			% string
	end
	
	% Get population
	population = data.Z(:,find(strcmp(data.Znames, 'Population'))); % K x 1
	
	% Make a dummy variable for summer2013: starts on June 16 (start of TV ad campaign and for rest of summer)
	if strcmp(config.timeAggLevel, 'day')
		summer2013_tts     = [167:243]; % (2013-06-16 to 2013-08-31) --> TV ad campaign from 2013-06-16 to July (not August based on total ad spend)
		TVshow20131219_tts = [353:354]; % (2013-12-19 to 2013-12-20) --> Envoye special appearance (France 2)
		TVshow20140105_tts = [370:371]; % (2014-01-05 to 2014-01-06) --> Zone interdite appearance (M6)
		TVshow20140112_tts = [377:378]; % (2014-01-12 to 2014-01-13) --> Capital appearance (M6)
		spike201302_tts    = [38:43];   % (2013-02-07 to 2013-02-12) --> ?
		photoContest_tts   = [294:310]; % (2013-10-21 to 2013-11-06)
		spike201311_tts    = [330:337]; % (2013-11-26 to 2013-12-03)
	end
	if strcmp(config.timeAggLevel, 'week')
		summer2013_tts     = [24:35]; % (2013-06-16 to 2013-08-31)
		TVshow20131219_tts = [47]; % (2013-12-19 to 2013-12-20)
		TVshow20140105_tts = [53]; % (2014-01-05 to 2014-01-06)
		TVshow20140112_tts = [54]; % (2014-01-12 to 2014-01-13)
		spike201302_tts    = [6 7]; % (2013-02-07 to 2013-02-12)
		photoContest_tts   = [43:45]; % (2013-10-21 to 2013-11-06)
		spike201311_tts    = [48 49]; % (2013-11-26 to 2013-12-03)
	end
	
	% Make a dummy for summer 2013 campaign
	summer2013 = zeros(Tall,1);
	summer2013(summer2013_tts) = 1;
	data.A      = [data.A summer2013];
	data.Anames = [data.Anames {'summer2013'}];
	
	% Make a dummy for TV appearance on 2013-12-19
	TVshow20131219 = zeros(Tall,1);
	TVshow20131219(TVshow20131219_tts) = 1;
	data.A      = [data.A TVshow20131219];
	data.Anames = [data.Anames {'TVshow20131219'}];
	
	% Make a dummy for TV appearance on 2014-01-05
	TVshow20140105 = zeros(Tall,1);
	TVshow20140105(TVshow20140105_tts) = 1;
	data.A      = [data.A TVshow20140105];
	data.Anames = [data.Anames {'TVshow20140105'}];
		
	% Make a dummy for TV appearance on 2014-01-12
	TVshow20140112 = zeros(Tall,1);
	TVshow20140112(TVshow20140112_tts) = 1;
	data.A      = [data.A TVshow20140112];
	data.Anames = [data.Anames {'TVshow20140112'}];
	
	% Make a dummy for unexplained spike (2013-02)
	spike201302 = zeros(Tall,1);
	spike201302(spike201302_tts) = 1;
	data.A      = [data.A spike201302];
	data.Anames = [data.Anames {'spike201302'}];
	
	% Make a dummy for unexplained spike (2013-11)
	spike201311 = zeros(Tall,1);
	spike201311(spike201311_tts) = 1;
	data.A      = [data.A spike201311];
	data.Anames = [data.Anames {'spike201311'}];
		
	% Make a dummy isWeekendDay
	[flag,colidx] = ismember('dayOfWeek', data.Anames);
	if flag
		dayOfWeek = data.A(:,colidx);
		isWeekendDay = double(dayOfWeek == 6 | dayOfWeek == 0); % 6=Saturday, 0=Sunday -- Question: add Fridays? (dayOfWeek==5) --> no.
		data.A = [data.A isWeekendDay];
		data.Anames = [data.Anames {'isWeekendDay'}];
		clear dayOfWeek isWeekendDay;
	end
	clear flag colidx;
	
	% Make variables for diploma levels
	belowBacDiplomaLevels = {'Fraction_DIPL_01','Fraction_DIPL_02','Fraction_DIPL_03','Fraction_DIPL_11','Fraction_DIPL_12','Fraction_DIPL_13','Fraction_DIPL_14'};
	aboveBacDiplomaLevels = {'Fraction_DIPL_17','Fraction_DIPL_18'};
	[~,below_dipl_idxes] = ismember(belowBacDiplomaLevels, data.Znames);
	[~,above_dipl_idxes] = ismember(aboveBacDiplomaLevels, data.Znames);
	FractionDiplBelowBac = sum(data.Z(:,below_dipl_idxes),2); % Kall x 1
	FractionDiplAboveBac = sum(data.Z(:,above_dipl_idxes),2); % Kall x 1
	data.Z = [data.Z FractionDiplBelowBac FractionDiplAboveBac];
	data.Znames = [data.Znames {'FractionDiplBelowBac', 'FractionDiplAboveBac'}];
	clear belowBacDiplomaLevels aboveBacDiplomaLevels below_dipl_idxes above_dipl_idxes;
			
	% Make a variable for car costs
	carCosts_varNames = {'Assurance', 'Entretien'};
	[~,carCosts_idxes] = ismember(carCosts_varNames, data.Xnames);
	carCosts = sum(data.X(:,:,carCosts_idxes),3); % Tall x Kall x 1
	data.Xnames = [data.Xnames {'Car costs'}];
	data.X = reshape(data.X, [Tall*Kall size(data.X,3)]);
	data.X = [data.X reshape(carCosts, [Tall*Kall 1])];
	data.X = reshape(data.X, [Tall Kall size(data.X,2)]);
	clear carCosts_varNames carCosts_idxes;
		
	%%%% Read geographic aggregations
	geoAggLevelNames = {};
	geoAggLevelLabels = {};
	for geoAggLevel = {'CantonId', 'DEP', 'oldRegionId' ,'RegionId'}
		% Make variables for geo-agg levels
		locationAggregationsFolder = config.locationAggregationsFolder;
		
		% Read geo-aggregation file
		myAggFile = sprintf('%s/%s.mat', locationAggregationsFolder, geoAggLevel{1});
		if ~isfile(myAggFile); continue; end;
		load(myAggFile, 'ids', 'idName', 'FE_Name', 'FEs', 'FE_labels');
		
		% Check consistency with data.geoLabels
		if ~isequal(ids, data.geoLabels); error('Mismatch in geo ids'); end;
		if ~isequal(idName, config.geoAggLevel); error('Mismatch in geo id name'); end;
		
		% Add as extra Z variable
		data.Z      = [data.Z      double(FEs)];
		data.Znames = [data.Znames FE_Name];
		
		NumGeoAggLevels = length(geoAggLevelNames);
		NumGeoAggLevels = NumGeoAggLevels + 1;
		geoAggLevelNames{NumGeoAggLevels}  = FE_Name;
		geoAggLevelLabels{NumGeoAggLevels} = FE_labels;
		
		clear ids idName FE_Name FEs FE_labels;
	end

	%%%% Read time aggregations
	timeAggLevelNames = {};
	timeAggLevelLabels = {};
	for timeAggLevel = {'dayOfWeek', 'week', 'month', 'quarter'}
		% Make variables for time-agg levels
		timeAggregationsFolder = config.timeAggregationsFolder;
		
		% Read time-aggregation file
		myAggFile = sprintf('%s/%s.mat', timeAggregationsFolder, timeAggLevel{1});
		if ~isfile(myAggFile); continue; end;
		load(myAggFile, 'ids', 'idName', 'FE_Name', 'FEs', 'FE_labels');
		
		% Check consistency with data.timeLabels
		if length(ids) ~= length(data.timeLabels); error('Mismatch in time ids'); end;
		
		% Add as extra A variable
		data.A      = [data.A      double(FEs)];
		data.Anames = [data.Anames FE_Name];
		
		NumTimeAggLevels = length(timeAggLevelNames);
		NumTimeAggLevels = NumTimeAggLevels + 1;
		timeAggLevelNames{NumTimeAggLevels}  = FE_Name;
		timeAggLevelLabels{NumTimeAggLevels} = FE_labels;
		
		clear ids idName FE_Name FEs FE_labels;
	end
	
	% Make dummy photoContest for Ile-de-France
	oldRegionId = data.Z(:,find(strcmp(data.Znames, 'oldRegionId'))); % K x 1
	IDF_idxes = find(oldRegionId == 1);
	paris_idx = find(~cellfun(@isempty, regexp(data.geoLabels,'^75'))); % index between 1 and Kall
	if ~ismember(paris_idx, IDF_idxes); error('Apparently 1 is not the correct oldRegionId for IDF...'); end;
	photoContest_IDF = zeros(Tall, Kall); % Tall x Kall
	photoContest_IDF(photoContest_tts, IDF_idxes) = 1;
	data.X = reshape(data.X, [Tall*Kall size(data.X,3)]); % (Tall*Kall) x NumX
	data.X = [data.X reshape(photoContest_IDF, [Tall*Kall 1])];
	data.X = reshape(data.X, [Tall Kall size(data.X,2)]); % Tall x Kall x NumX
	data.Xnames = [data.Xnames {'photoContest_IDF'}];
end
